<template>
  <div>
    <el-row>
      <el-button v-for="(t, index) in times" :key="index">{{t}}</el-button>
    </el-row>
    <el-row v-for="(d, index) in votes" :key="index">
      <div>{{d.name}}</div>
      <el-button v-for="(v, index) in d.range" :key="index">
        {{v}}
      </el-button>
    </el-row>
    <el-row>
      <el-form :inline="true" class="demo-form-inline">
        <el-form-item>
          <el-button type="primary">四家票数</el-button>
        </el-form-item>
        <el-form-item>
          <el-input v-model="addData[0]" placeholder=""></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="addData[1]" placeholder=""></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="addData[2]" placeholder=""></el-input>
        </el-form-item>
        <el-form-item>
          <el-input v-model="addData[3]" placeholder=""></el-input>
        </el-form-item>
        <el-form-item label="计票时段">
          <el-input v-model="time" placeholder=""></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="onSubmit">查询</el-button>
        </el-form-item>
      </el-form>
    </el-row>
  </div>
</template>

<script>
export default {
  data () {
    return {
      length: 5,
      times: ['11:20', '11:30', '11:40', '11:50'],
      addData: [],
      time: '',
      votes: [{
        name: '红',
        datas: [131037, 131241, 131440, 131695, 131973],
        range: [204, 199, 255, 278]
      }, {
        name: 'wjsn',
        datas: [131037, 131241, 131440, 131695, 131973],
        range: [125, 150, 171, 215]
      }, {
        name: 'winner',
        datas: [131037, 131241, 131440, 131695, 131973],
        range: [100, 131, 102, 85]
      }, {
        name: 'X',
        datas: [131037, 131241, 131440, 131695, 131973],
        range: [0, 139, 121, 128]
      }]
    }
  },
  methods: {
    onSubmit () {
      this.times.concat([this.time])
      console.log(this.addData)
    }
  }
}
</script>
<style>
  .el-table .warning-row {
    background: oldlace;
  }

  .el-table .success-row {
    background: #f0f9eb;
  }
</style>
